package com.qf.test;

import com.qf.dao.AddressMapper;
import com.qf.dao.UserMapper;
import com.qf.pojo.TbAddress;
import com.qf.util.MyBatisUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.List;

/*
 *@Description:
 *@author:刘哥
 *@Date:86180 2022/8/24 11:24
 */
public class Demo3 {
    private UserMapper userMapper;
    private AddressMapper addressMapper;

    @Before
    public void before(){
        userMapper=MyBatisUtils.getMapper(UserMapper.class);
        addressMapper=MyBatisUtils.getMapper(AddressMapper.class);
    }
    @After
    public void close(){
        MyBatisUtils.commit();
        MyBatisUtils.close();
    }
    @Test
    public void test01(){
        List<TbAddress> tbAddresses = addressMapper.selectAll();
        for (TbAddress tbAddress : tbAddresses) {
            System.out.println("tbAddress = " + tbAddress);
        }
    }
}
